package com.study.View;
import com.study.*;
import java.util.Scanner;
import com.study.Model.*;
import com.study.Controller.*;
public class CustomerUi {

   private Scanner input=new Scanner(System.in);
  private CustomerController customerControllerd=new CustomerController(10);
    public void  menu(){
     menu:while (true){
    //显示菜单
    System.out.println(".................客户细腻些管理系统.................");
    System.out.println("                 1.添加用户");
    System.out.println("                 2.修改用户");
    System.out.println("                 3.删除用户");
    System.out.println("                 4.查看用户");
    System.out.println("                 5.退出");
    System.out.println("请输入[1-5]");
    //接受用户命令
    int code=input.nextInt();
    if (!(code>=1&&code<=5)){
        System.out.println("输入有误，请重新输入");
         continue;
    }
    else {
        switch (code){
            case 1:
                addCustomer();
                System.out.println("添加用户");
            break;
            case 2:
                System.out.println("2");
                break;
            case 3:
                System.out.println("3");
                break;
            case 4:
                System.out.println("4");
                break;
            case 5:
                while (true){
                    System.out.println("是否退出y/n");
                    String next = input.next();
                    if (next.equalsIgnoreCase("y")){
                        System.out.println("退出成功");
                        return;
                    } else if (next.equalsIgnoreCase("n")) {
                        continue menu;
                    }
                }
        }

    }
}

    }

    private void addCustomer() {
        System.out.println("...................添加用户...................");
        System.out.println("姓名");
        String name=input.next();
        System.out.println("性别");
        int sex=input.nextInt();
        System.out.println("年龄");
        int age=input.nextInt();
        System.out.println("手机号");
        int mobilephone=input.nextInt();
        System.out.println("邮箱");
        String emile=input.next();
        Customer customer=new Customer(name,sex,age,mobilephone,emile);
    }

    public static void main(String[] args) {
        CustomerUi a=new CustomerUi();
        a.menu();
    }
}
